package com.youku.mson.type;

import com.youku.mson.util.TypeAdapter;
import com.youku.mson.util.TypeUtils;

public class StringJsonValue implements JsonValue {

	private String value;

	public StringJsonValue(String value) {
		this.value = value;
	}

	@Override
	public Object read(TypeAdapter adapter) {
		if (TypeUtils.isCharacter(adapter.getTargetClass())) {
			return value.toCharArray()[0];
		} else {
			return value;
		}
	}

}
